<template>
  <section class="padding EndWaybillList">
    <el-card class="margin-top">
      <div slot="header" class="clearfix relative">
        <span class="title-icon">流水记录</span>
      </div>

      <TableModule :table-columns="tableColumns" :table-data="tableData" />
    </el-card>
  </section>
</template>

<script>
import TableModule from '@/components/TableModule'
import { pageList } from '@/api/quickRepayment'

export default {
  name: 'FlowRecord',
  components: {
    TableModule
  },
  data() {
    return {
      disabled: false,
      tableData: [],
      tableColumns: [
        { prop: 'bankStatementAmount', label: '流水金额' },
        { prop: 'statementStatusName', label: '状态' },
        { prop: 'rechargePicture', label: '充值图片', type: 'img' },
        { prop: 'customerRemark', label: '备注' },
        { prop: 'cdate', label: '创建时间' }
      ]
    }
  },
  mounted() {
    this.init()
  },
  methods: {
    async init() {
      this.$store.dispatch('app/toggleDialog', true)
      const dataList = await pageList({})
      // console.log(dataList)
      const statusMap = dataList.bankStatementStatus

      if (dataList.datas && dataList.datas.length > 0) {
        dataList.datas.forEach(data => {
          data.statementStatusName = this.$t(
            'finance.' + statusMap[data.statementStatus]
          )
        })
      }
      this.tableData = dataList.datas
      this.$store.dispatch('app/toggleDialog', false)
    },
    handleSizeChange(val) {
      // console.log(`每页 ${val} 条`)
    },
    handleCurrentChange(val) {
      // console.log(`当前页: ${val}`)
    }
  }
}
</script>

<style scoped>
.EndWaybillList >>> .el-textarea__inner {
  min-height: 60px !important;
}
</style>

<style lang="scss" scoped>
.item {
  position: absolute;
  right: -25px;
  top: 3px;
  font-size: 20px;
}

.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
.avatar {
  width: 178px;
  height: 178px;
  display: block;
}
</style>
